#ifndef LOCALBACKUPTASK_H
#define LOCALBACKUPTASK_H

#include <QRunnable>
#include <QString>
#include <QFile>
#include <QTextStream>
#include <vector>
#include <QDebug>
#include <QTcpSocket>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonParseError>
#include <QByteArray>

#include "global_header/globaldata.h"

class LocalBackUpTask : public QRunnable
{
private:
    QString path_;
    std::vector<QString> dates_;
    std::vector<double> temperatures_;
    std::vector<double> humidities_;
    QFile file_;

public:
    LocalBackUpTask(const QString& path, std::vector<QString>& dates,
                    std::vector<double>& temperatures, std::vector<double>& humidities);

public:
    virtual void run() override;
};

class CloudBackUpTask : public QRunnable
{
private:
    QString mac_;
    std::vector<QString> dates_;
    std::vector<double> temperatures_;
    std::vector<double> humidities_;

public:
    CloudBackUpTask(const QString& mac, std::vector<QString>& dates,
                    std::vector<double>& temperatures, std::vector<double>& humidities);

public:
    virtual void run() override;
};

#endif // LOCALBACKUPTASK_H
